package com.wtwd.campus.attendancesend;

import com.wtwd.campus.common.Constants;
import com.wtwd.campus.entity.AttendanceCommand;
import com.wtwd.campus.entity.MqMessage;


public class AttendanceSendDataReplySender implements AttendanceSender {
    @Override
    public AttendanceCommand dealMessage(MqMessage mqMessage) {
        String str = (String) mqMessage.getObject();
        String[] split = str.split(",");
        String serialNo=split[0];
        String productNo = split[1];
        String length="0001";
        String content="5A".concat(Constants.SEND_DATA).concat(length).concat(serialNo);
        String xor=getXOR(content.substring(2));
        content=content.concat(xor).concat("CA");
        AttendanceCommand command=new AttendanceCommand();
        command.setContent(content);
        command.setProductNo(productNo);
        return command;
    }
}
